package sys.tests.automatLogic;

import sys.fsm.*;
import sys.message.*;
import sys.transport.*;
import sys.database.*;

public class Test1
{
    public static void startTest(String DBHost, String DBName, String user, String pass)
    {
        System.out.println("---------------------------------------------------");
        System.out.println("Test1. Good scenario. From Init state to Done state");
        System.out.println("---------------------------------------------------");
        try
        {
            DBWrapper dbw = new DBWrapper(DBHost, DBName, user, pass);
            dbw.connect();
            dbw.delete("Request", "ID = 0");
            dbw.disconnect();

            Automat a = new Automat(0, "//home//chigorin//botva//term10//my//ds//cw//distsyst//sysa//src//sys//fsm//config");

            a.start_Message(0, "ps_1", "user_1", 10);

            Thread.sleep(2500);
            a.ack_Seller_1_Message();

            Thread.sleep(2000);
            a.ack_PayingSystem_1_Message();

            Thread.sleep(1000);
            a.ack_User_1_Message();

            Thread.sleep(1000);
            a.ack_Seller_2_Message();
        }
        catch(Exception e) {}
    }
}
